package charactor;

import java.util.Arrays;
import java.util.Scanner;

/**
 * Created by MtRider on 2021/10/17 12:11
 * @author mystory
 */
public class CombineChar {
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        String a1 = input.nextLine();
        String a2 = input.nextLine();
        String a3 = input.nextLine();
        String a4 = input.nextLine();
        String[] s1 = a2.split(" ");
        String[] s2 = a4.split(" ");
        Integer[] integers1 = new Integer[Integer.parseInt(a1)];
        Integer[] integers2 = new Integer[Integer.parseInt(a3)];
        for (int i = 0; i < integers1.length; i++) {
            integers1[i]=Integer.valueOf(s1[i]);
        }
        for (int i = 0; i < integers2.length; i++) {
            integers2[i]=Integer.valueOf(s2[i]);
        }
        Integer[] integers3 = new Integer[integers1.length+integers2.length];
        System.arraycopy(integers1, 0, integers3, 0, integers1.length);
        System.arraycopy(integers2, 0, integers3, integers1.length, integers2.length);
        Arrays.sort(integers3);
        for (Integer integer : integers3) {
            System.out.print(integer+" ");

        }
    }
}
